package com.industry.system.satoken;

import cn.dev33.satoken.stp.StpUtil;
import com.industry.system.dal.dataobject.SystemUser;

public class StpContextHelper {

    public static String USER_INFO = "USER_INFO";

    public static void setUserInfo(SystemUser systemUser){
        StpUtil.getSessionByLoginId(systemUser.getId()).set(USER_INFO, systemUser);
    }

    public static SystemUser getUserInfo(){
        return (SystemUser) StpUtil.getSession().get(USER_INFO);
    }

}
